package sh.model;

import lombok.Data;
import sh.orm.annotation.Entity;
import sh.orm.annotation.JoinColumn;
import sh.orm.annotation.OneToMany;
import sh.orm.annotation.OneToOne;

import java.util.List;

@Data
@Entity
public class Cart extends AbstractModel {

	private Long userId;
	private String cartState;
	@OneToMany
	@JoinColumn(name = "cartId")
	private transient List<CartItem> cartItems;


	/** 一个人只有一个购物车 */
	@OneToOne
	@JoinColumn(name = "id")
	private transient User user;

}
